{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ff2b5ab3-229d-48f1-8ea2-71c7bd4259d8",
   "metadata": {},
   "outputs": [],
   "source": [
    "a = float(input(\"请输入第一个数\"))\n",
    "b = float(input(\"请输入第二个数\"))\n",
    "c = a+b\n",
    "d = a-b\n",
    "e = a*b\n",
    "f = a/b\n",
    "g = a%b\n",
    "h = a ** b\n",
    "i = a//b\n",
    "print(\"两数之和\",c)\n",
    "print(\"减\",d)\n",
    "print(\"乘\",e)\n",
    "print(\"除\",f)\n",
    "print(\"整数商\",i)\n",
    "print(\"取余\",g)\n",
    "print(\"a的b次幂\",h)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "71e617ab-69b6-49af-bb23-0d18f9b16770",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "请输入一个数 3\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "两数的平方 9.0\n",
      "两数的立方 27.0\n"
     ]
    }
   ],
   "source": [
    "a = float(input(\"请输入一个数\"))\n",
    "b = a**2\n",
    "c = a**3\n",
    "print(\"两数的平方\",b)\n",
    "print(\"两数的立方\",c)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3fbb73aa-35ca-43cf-ab7c-b297ce2679ed",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "请输入半径 2\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "圆的面积 12.566370614359172\n",
      "圆的周长 12.566370614359172\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "a = float(input(\"请输入半径\"))\n",
    "b = math.pi*a**2\n",
    "c = 2*a*math.pi\n",
    "print(\"圆的面积\",b)\n",
    "print(\"圆的周长\",c)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "60429062-c6f4-45eb-9089-dc23109373bf",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "请输入第一个边长 3\n",
      "请输入第二个边长 4\n",
      "请输入第三个边长 5\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "三角形周长 12.0\n",
      "三角形面积 6.0\n"
     ]
    }
   ],
   "source": [
    "a = float(input(\"请输入第一个边长\"))\n",
    "b = float(input(\"请输入第二个边长\"))\n",
    "c = float(input(\"请输入第三个边长\"))\n",
    "d = a+b+c\n",
    "p = (a+b+c)/2\n",
    "f = (p*(p-a)*(p-b)*(p-c))**(1/2)\n",
    "print(\"三角形周长\",d)\n",
    "print(\"三角形面积\",f)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b3d61f52-be87-4768-8e4a-144d84c8f5ed",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
